'use strict';
import * as types from '../Commom/ActionConst';
import RuralLibraryAPIService from '../Commom/RuralLibraryAPIService';
export let citiesList = () => {
    return (dispatch) => {
        dispatch({'type': types.kCityList});
        RuralLibraryAPIService.citiesList().then((ret)=> {
            console.log(ret);
            dispatch({type: types.kCityListReceived, result: ret});
        }).catch((err)=> {
            dispatch({type: types.kCityListReceived, result: null});
        });
    }
}
export let ruraLibraryImagesList = () => {
    return (dispatch) => {
        dispatch({'type': types.kRuraLibraryImagesList});
        RuralLibraryAPIService.ruraLibraryImagesList().then((ret)=> {
            console.log(ret);
            dispatch({type: types.kRuraLibraryImagesListReceived, result: ret});
        }).catch((err)=> {
            dispatch({type: types.kRuraLibraryImagesListReceived, result: null});
        });
    }
}
export let ruralLibraryList = (longitude, latitude, town) => {
    return (dispatch) => {
        dispatch({'type': types.kRuralLibraryList});
        RuralLibraryAPIService.ruralLibraryList(longitude, latitude, town).then((ret)=> {
            console.log(ret);
            dispatch({type: types.kRuralLibraryListReceived, result: ret});
        }).catch((err)=> {
            dispatch({type: types.kRuralLibraryListReceived, result: null});
        });
    }
}